<me:UIABFQC x:Class="WPFExcelReport.TABFQCBX"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:GS="clr-namespace:WPFExcelReport;assembly=TGSDAT"  
                    xmlns:MU="clr-namespace:WPFExcelReport;assembly=TABAUFM"  
                    xmlns:GP="clr-namespace:WPFExcelReport;assembly=TGPDAT"  
                   xmlns:QP="clr-namespace:WPFExcelReport;assembly=TQPPLAN"  
                   xmlns:GSC="clr-namespace:WPFExcelReport;assembly=TGSCOLOR"  
            xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    Background="White"  
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIABFQC.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:Divideby100 x:Key="d100"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <ucd:Divideby1000  x:Key="d1000"/>
    </me:UIABFQC.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Background="{StaticResource QueryZoneBrush}">
            <WrapPanel >
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=批次:}}" FontSize="18"></TextBlock>
                    <MU:TSKDP Visibility="Collapsed"  Grid.Column="1" GSART="{Binding KEY,ElementName=cGS02}" KEY="{Binding GPPARTIE,ElementName=TV}"/>
                    <TextBox  Grid.Column="2" MaxLength="10" Height="30" KeyUp="QUERY_KeyUp" Background="White" FontSize="18" CharacterCasing="Upper" Text="{Binding GPPARTIE,ElementName=TV}" Width="130" />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>

                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=色号:}}" FontSize="18"></TextBlock>
                    <GSC:TSGS06 Visibility="Collapsed"  Grid.Column="1" GSART="{Binding KEY,ElementName=cGS02}" KEY="{Binding FARBE,ElementName=TV}"/>
                    <TextBox MaxLength="10" Grid.Column="2" Height="30" Background="White" FontSize="18" KeyUp="QUERY_KeyUp" CharacterCasing="Upper" Text="{Binding FARBE,ElementName=TV}" Width="100" />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=纱型:}}" FontSize="18"></TextBlock>
                    <TextBox  Grid.Column="1"  Height="30" KeyUp="QUERY_KeyUp" Background="White" FontSize="18" CharacterCasing="Upper" Text="{Binding TYPE ,ElementName=TV}" Width="60" />
                    <TextBlock  Grid.Column="3" Text="{Binding Source={Localization:Translate Word=纱支:}}" FontSize="18"></TextBlock> 
                    <TextBox  Grid.Column="4" MaxLength="4" Height="30" KeyUp="QUERY_KeyUp" Background="White" FontSize="18" CharacterCasing="Upper" Text="{Binding YCOUNT,ElementName=TV}" Width="60" />
                </Grid>
                <Grid Margin="10,0,0,0" Visibility="Collapsed">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>

                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=纱线:}}"></TextBlock>
                    <GS:TSGS02  Grid.Column="1" Name="cGS02" KEY="{Binding ART,ElementName=TV}"  ART="{Binding GSART,ElementName=TV}"/>
                    <ex:TXT72   Grid.Column="2" CharacterCasing="Upper" Text="{Binding ART}" Width="100" />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Label Content="{Binding Source={Localization:Translate Word=检验日期从}}" Grid.Column="0"  HorizontalAlignment="Left" Margin="10,0,0,0"  Width="Auto" FontSize="18" />
                    <DatePicker Height="30" Grid.Column="1" HorizontalAlignment="Left" Margin="5,0,0,0"   
                            Text="{Binding FROMDATE,ElementName=TV}" FontSize="18" SelectedDateChanged ="FROM_DATE_SelectedDateChanged"  Width="140" />
                    <Label Content="{Binding Source={Localization:Translate Word=到}}"  Grid.Column="2" Height="28" HorizontalAlignment="Left" Margin="10,0,0,0"   Width="Auto" FontSize="18" />
                    <DatePicker Height="30"  Grid.Column="3" HorizontalAlignment="Left" Margin="5,0,0,0"   VerticalAlignment="Center" 
                                  Text="{Binding ENDDATE,ElementName=TV}"  FontSize="18"  SelectedDateChanged ="END_DATE_SelectedDateChanged" Width="140" />
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button  Click="QUERY_CLICK"  Content="{Binding Source={Localization:Translate Word=查询检验数据}}" FontSize="18" Height="40" Margin="5,2,0,2" />
                </Grid>
                <Grid Margin="10,0,0,0" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <DR:TDRAUFTR  Grid.Column="0" Name="cDR" DocType="{Binding QCDOCTYP,ElementName=TV}" PrintType="OpenExcel" />
                    <Button  Grid.Column="1"  Click="PrintCommand" Height="Auto" FontSize="18" Margin="5,0,0,0" Width="Auto" Content="{Binding Source={Localization:Translate Word=导出}}" />
                </Grid>
            </WrapPanel>
            <WrapPanel>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button  Click="QueryCommand" Name="btnQU" Content="{Binding Source={Localization:Translate Word=查询}}" FontSize="18" Height="40" Margin="5,0,0,0" Width="80" >
                        <!--Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                        </Button.Background-->
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button  Click="EditCommand" Name="btnED" Content="{Binding Source={Localization:Translate Word=编辑}}" FontSize="18" Width="80" Height="40">
                        <!--Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                        </Button.Background-->
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="NewCommand" Name="btnNEW" Content="{Binding Source={Localization:Translate Word=新建}}" FontSize="18" Height="40" Margin="5,0,0,0" Width="80" >
                        <!--Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                        </Button.Background-->
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="DeleteCommand" Name="btnDEL" Content="{Binding Source={Localization:Translate Word=删除}}" FontSize="18" Height="40" Margin="5,0,0,0" Width="80" >
                        <!--Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                        </Button.Background-->
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="SaveCommand"  FontSize="18" Height="30" Margin="5,0,0,0" Width="80" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                        </Button.Background>
                    </Button>
                </Grid>
            </WrapPanel>
            <WrapPanel>
                <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=多个批次:}}" FontSize="18"></TextBlock>
                <TextBox  Grid.Column="2"   Height="30" KeyUp="QUERY_KeyUp" FontSize="18" Background="pink" CharacterCasing="Upper" Text="{Binding GPPARTIEC,ElementName=TV}" Width="1650"   />
            </WrapPanel>
        </StackPanel>
        <Border Grid.Row="1" BorderThickness="2,2,0,0" BorderBrush="{StaticResource BorderBrush}">
            <DataGrid  Grid.Row="1"  
                   VerticalAlignment="Top" 
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"  
                   ItemsSource="{Binding Source={StaticResource vwMaster}}"  
                   IsSynchronizedWithCurrentItem="True" 
                   IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                   x:Name="dlgMaster"  
                     SelectionMode="Single"
                   RowDetailsVisibilityMode="Visible"  
                >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=GPPARTIE, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=批次}}" Foreground="RED" IsReadOnly="True" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QOKORDER, Converter={StaticResource pnum}}" Header="{Binding Source={Localization:Translate Word=质检单}}" Foreground="Red"  IsReadOnly="True" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABPART, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=纱线}}" Foreground="Red"  IsReadOnly="True" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABPFARBE, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=色号}}" Foreground="Red"  IsReadOnly="True" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABFAUFLFD, Converter={StaticResource pnum}}" Header="{Binding Source={Localization:Translate Word=生产单}}" Foreground="Red"  IsReadOnly="True" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=QOKNEUD}" Header="{Binding Source={Localization:Translate Word=检验日期}}" Foreground="Red"  IsReadOnly="True" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=TYP, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=纱型}}" Foreground="RED" IsReadOnly="True" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=B001}" Header="{Binding Source={Localization:Translate Word=支数值}}"  Width="48" />
                    <DataGridTextColumn Binding="{Binding Path=B002}" Header="{Binding Source={Localization:Translate Word=条干CV%}}"  Width="60" />
                    <DataGridTextColumn Binding="{Binding Path=B003}" Header="{Binding Source={Localization:Translate Word=细节-50%}}"  Width="64" />
                    <DataGridTextColumn Binding="{Binding Path=B004}" Header="{Binding Source={Localization:Translate Word=粗节+50%}}"  Width="68" />
                    <DataGridTextColumn Binding="{Binding Path=B005}" Header="{Binding Source={Localization:Translate Word=棉结+140%}}"  Width="75" />
                    <DataGridTextColumn Binding="{Binding Path=B006}" Header="{Binding Source={Localization:Translate Word=棉结+200%}}"  Width="75" />
                    <DataGridTextColumn Binding="{Binding Path=B007}" Header="{Binding Source={Localization:Translate Word=棉结+280%}}"  Width="75" />
                    <DataGridTextColumn Binding="{Binding Path=B008}" Header="{Binding Source={Localization:Translate Word=毛羽H}}"  Width="45" />
                    <DataGridTextColumn Binding="{Binding Path=B009}" Header="{Binding Source={Localization:Translate Word=单强CN}}"  Width="50" />
                    <DataGridTextColumn Binding="{Binding Path=B010}" Header="{Binding Source={Localization:Translate Word=最小强力CN}}"  Width="75" />
                    <DataGridTextColumn Binding="{Binding Path=B011}" Header="{Binding Source={Localization:Translate Word=单强CV%}}"  Width="60" />
                    <DataGridTextColumn Binding="{Binding Path=B012}" Header="{Binding Source={Localization:Translate Word=强度CN/TEX}}"  Width="78" />
                    <DataGridTextColumn Binding="{Binding Path=B013}" Header="{Binding Source={Localization:Translate Word=断裂伸长E}}"  Width="65" />
                    <DataGridTextColumn Binding="{Binding Path=B014}" Header="{Binding Source={Localization:Translate Word=捻度T/10CM}}"  Width="79" />
                    <DataGridTextColumn Binding="{Binding Path=B015}" Header="{Binding Source={Localization:Translate Word=捻度CV%}}"  Width="60" />
                    <DataGridTextColumn Binding="{Binding Path=B050,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=备注}}"  Width="60" />
                </DataGrid.Columns>
            </DataGrid  >
        </Border>
    </Grid>
</me:UIABFQC>
